//
//  IMChatInputView.h
//  MLIM
//
//  Created by molon on 15/6/25.
//  Copyright (c) 2015年 molon. All rights reserved.
//

#import <UIKit/UIKit.h>

#define kMinInputPanelHeight 50.0f

typedef NS_ENUM(NSUInteger, IMChatInputMode) {
    IMChatInputModeNone = 0, //默认模式,即为显示输入框，但是不显示键盘的模式
    IMChatInputModeKeyboard,//键盘显示时候
    IMChatInputModeVoice,//语音按钮显示时候
    IMChatInputModeMore,  //更多按钮显示时候
};

typedef NS_OPTIONS(NSUInteger, IMChatInputEnableMode) {
    IMChatInputEnableModeNone = 0, //无
    IMChatInputEnableModeVoice = 1<<0,//音频
    IMChatInputEnableModeMore = 1<<1,//更多
    IMChatInputEnableModeAll = NSUIntegerMax,    // 所有
};

@protocol IMChatInputBottomViewDelegate <NSObject>

- (CGFloat)preferredHeight;

@end

@class HPGrowingTextView;
@interface IMChatInputView : UIView

@property (readonly, nonatomic, strong) HPGrowingTextView *textView;
@property (readonly, nonatomic, assign) UIView<IMChatInputBottomViewDelegate> *moreView;

//输入模式
@property (nonatomic, assign) IMChatInputMode inputMode;

//启用模式
@property (nonatomic, assign) IMChatInputEnableMode enableModes;

//合适高度有变化
@property (nonatomic, copy) void(^preferredHeightChangedBlock)(IMChatInputView *inputView,BOOL shouldAnimate,UIViewAnimationCurve animationCurve,CFTimeInterval animationDuration);

//发送文本信息的block
@property (nonatomic, copy) void(^sendContentMessageBlock)(NSString *messageContent);

//发送音频消息
@property (nonatomic, copy) void(^sendAudioMessageBlock)(NSURL *filePath,NSTimeInterval durantion);


- (instancetype)initWithMoreView:(UIView<IMChatInputBottomViewDelegate> *)moreView;

//这玩意的合适高度
- (CGFloat)preferredHeight;

//停止当前录音
- (void)stopIfRecording;

@end
